<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
      <el-row>
        <el-col :span="12">
          <el-form-item label="编码" prop="code" v-if="false">
            <el-input v-model="model.code"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="名称" prop="name" :rules="rules.validateRequire">
            <el-input v-model="model.name"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="排序码" prop="sortcode">
            <el-input-number v-model="model.sortcode" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="所属流程" prop="dispflowid">
            <el-input v-model="model.dispflowid" disabled></el-input>
            <!--						<el-input-number v-model="model.dispflowid" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>-->
            <!--            <tl-ref-tree-module v-model="model.flowid" :initDisplayData.sync="model.dispflowid" :queryTreeUrl="url.queryApprovalFlowTree" :queryDataUrl="url.queryApprovalFlowList" treeQueryKey="qry_parentid" :singleSelect="true"></tl-ref-tree-module>-->
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="所属流程节点" prop="dispnodeid">
            <el-input v-model="model.dispnodeid" disabled></el-input>
            <!--						<el-input-number v-model="model.dispnodeid" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>-->
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="检查项要求" prop="introduce">
            <el-input v-model="model.introduce" type="textarea" :rows="4"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="有效" prop="enabled" v-if="false">
            <el-radio-group v-model="model.enabled">
              <el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
  /** mixins */
  import { mixin_edit } from '@tapui/mixins/mixin_edit'
  /** 子组件 */
  import tlRefTreeModule from '@tapui/components/Tap/Ref/RefTree'
  /** 工具类 */
  import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'

  /** VUE配置 */
  export default {
    mixins: [mixin_edit],
    components: { tlRefTreeModule },
    data() {
      return {
        moduleTitle: '流程检查项',
        urlPrefix: '/base/flowCheckItem/',
        url: {
          // 额外的url
        }
      }
    },
    props: {
      flowId: {
        default: '',
        type: String
      },
      nodeId: {
        default: '',
        type: String
      },
      dispNodeId: {
        default: '',
        type: String
      },
      dispFlowId: {
        default: '',
        type: String
      }
    },
    methods: {
      loaded() {
        // 页面加载完毕执行
        if (this.flowId) {
          this.$set(this.model, "flowid", this.flowId)
        }
        if (this.nodeId) {
          this.$set(this.model, "nodeid", this.nodeId)
        }
        if (this.dispNodeId) {
          this.$set(this.model, "dispnodeid", this.dispNodeId)
        }
        if (this.dispFlowId) {
          this.$set(this.model, "dispflowid", this.dispFlowId)
        }
      }
    }
  }
</script>

